package com.zsjt.app.pojo;


import com.zsjt.app.compoent.utils.common.ComUtils;

public class UserDto {

    private int id;
    private int type;
    private String name;
    private String username;
    private String account;
    private String email;
    private String phone;
    private String password;

    public void setUsername(String username) {
        this.username = username;
    }

    public String getUsername() {
        return username;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", type=" + type +
                ", name='" + name + '\'' +
                ", account='" + account + '\'' +
                ", email='" + email + '\'' +
                ", phone='" + phone + '\'' +
                ", password='" + password + '\'' +
                '}';
    }

    public String getTypeStr() {
        String typeStr = "";
        switch(type) {
            case 1:typeStr = "员工";break;
            case 8:typeStr = "管理员";break;
        }
        return typeStr;
    }

    /**
     * 隐藏邮箱
     * @return
     */
    public String getHideEmail(){
        return ComUtils.HideEmail(email);
    }

    /**
     *隐藏手机号码
     * @return
     */
    public String getHidePhone(){
        return ComUtils.HidePhone(phone);
    }


}
